# ---------------------------------------------------------------------------------------------------- #
# _Fariss_HR_Treaty_Compliance_README.txt
# ---------------------------------------------------------------------------------------------------- #

 Date: 2015-05-08

 Authors: Christopher J. Fariss

 Title: The Changing Standard of Accountability and the Positive Relationship between Human Rights Treaty Ratification and Compliance  
 Most recent version available at: http://ssrn.com/abstract=2517457

 Contact: 
   Chris Fariss: cjf0006@gmail.com

 Copyright (c) 2015, under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
 For more information see: http://creativecommons.org/licenses/by-nc-sa/3.0/us/
 All rights reserved. 


# ---------------------------------------------------------------------------------------------------- #
# install R and necessary packages for analysis
# ---------------------------------------------------------------------------------------------------- #

open the .R file using any text or source code editor such as:
	TextEdit, emacs, Aquamacs, notepad++ , or Xpad

set the working directory to the folder containing the data files 

the set working directory command in R is setwd()
	type ?setwd for help documentation 

to set the path type into R: 

setwd("PATH_NAME")

where PATH_NAME is the path to the folder with the data

install packages if necessary:
	install.packages("MASS")
	install.packages("foreign")
	install.packages("reshape")
	install.packages("xtable")
	install.packages("rjags")

You should place the folders that contain this file and the additional folders it contains into the R working directory. 

The R working directory is available via the getwd() function in R.

The attached code makes use of the file structure. As long as the folders are in the R working directory the script will find these files and work properly. 

The last version of R and Mac OS-X are:

	R version 3.1.1 (2014-07-10) -- "Sock it to Me"
	Copyright (C) 2014 The R Foundation for Statistical Computing
	Platform: x86_64-apple-darwin10.8.0 (64-bit)

The rjags library will only install after the successful installation of JAGS, which can be downloaded here: http://mcmc-jags.sourceforge.net/


# ---------------------------------------------------------------------------------------------------- #
# file folder descriptions
# ---------------------------------------------------------------------------------------------------- #

HR_Treaty_IRT_Curves (FILE FOLDER)	HR_Treaty_IRT_Curves_LONG.R --- R code file creates table and figure displayed in the appendix	HR_Treaty_IRT_Curves_WIDE.R --- R code file creates table and figure displayed in the appendixHR_treaty_latent_variable_JAGS_model (FILE FOLDER)	hr_treaties.csv --- data file with the binary treaty indicators	HR_treaty04.bug --- JAGS code file called by HR_treaty04.R	HR_treaty04.R --- R code file to create the latent treaty variableLatent_Treaty_Correlation_Rplots (FILE FOLDER)	CYEstimateLatentHRtreaty04.csv --- data file that contains the latent treaty estimates 	LatentTreaty_Correlation_COUNT_Rplot.R --- R code file creates scatter plot between one of two count treaty variables and the latent treaty variable 	LatentTreaty_Correlation_PROPORTION_Rplot.R --- R code file creates scatter plot between the proportion treaty variables and the latent treaty variable ModelTreaty_Rcode (FILE FOLDER)	CYEstimateLatentHRtreaty04.csv --- data file that contains the latent treaty estimates 	CYLatentRepressionConstantStandardDynamicX02.csv --- data file from Fariss (2014)	CYLatentRepressionDynamicStandardDynamicX02.csv --- data file from Fariss (2014)	gdpv6.txt --- data file that contains the updated Gleditcsh GDP and population data	hr_treaties.csv --- data file that contains the latent treaty estimates	ModelTreatyDifferencesCAT01.R --- R code file estimates regression models with the CAT treaty variable	ModelTreatyDifferencesCCPR01.R --- R code file estimates regression models with the CCPR treaty variable 	ModelTreatyDifferencesCEDAW01.R --- R code file estimates regression models with the CEDAW treaty variable 	ModelTreatyDifferencesCERD01.R --- R code file estimates regression models with the CERD treaty variable 	ModelTreatyDifferencesCESCR01.R --- R code file estimates regression models with the CESCR treaty variable 	ModelTreatyDifferencesCRC01.R --- R code file estimates regression models with the CCRC treaty variable 	ModelTreatyDifferencesLATENTTREATY.R --- R code file estimates regression models with the Latent treaty variable 	ModelTreatyDifferencesTREATYCOUNT.R --- R code file estimates regression models with the 2 count treaty variable 	ModelTreatyDifferencesTREATYPROPORTION.R --- R code file estimates regression models with the proportion treaty variable 	p4v2010.csv --- data file that contains the polity IV variable


# ---------------------------------------------------------------------------------------------------- #
# References
# ---------------------------------------------------------------------------------------------------- #

Fariss, Christopher J. 2014. “Respect for Human Rights has Improved Over Time: Modeling the Chang- ing Standard of Accountability in Human Rights Documents.” American Political Science Review 108(2):297–318.

Gleditsch, Kristian Skrede. 2002. “Expanded trade and GDP data.” Journal of Conflict Resolution 46(5):712–724.

Marshall, Monty, Keith Jaggers and Ted R. Gurr. 2013. “Polity IV Project: Political Regime Character- istics and Transitions 1800-2010 Dataset Users’ Manual.”.URL: www.systemicpeace.org/polity/polity4.htm

# ---------------------------------------------------------------------------------------------------- #
# end file
# ---------------------------------------------------------------------------------------------------- #
